package com.cxy.web;

import java.util.List;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;

import com.cxy.pojo.Issues;
import com.cxy.pojo.Message;
import com.cxy.services.IssuesServices;
import com.cxy.services.MessageServices;

@Results(@Result(location="index.jspx",name=MainAction.INDEX,type="redirectAction"))
public class MainAction extends SimpleBaseAction {
	private static final long serialVersionUID = 6979374287479953841L;
	public static final String INDEX = "index";
	@Resource
	private MessageServices messageServices;
	@Resource
	private IssuesServices issuesServices;
	private List<Message> messageList;
	private List<Issues> issuesList;
	public String execute(){
		messageList = messageServices.find();
		issuesList = issuesServices.find();
		return SUCCESS;
	}
	public String exit(){
		getHttpSession().invalidate();
		return INDEX;
	}
	
	
	//get and set
	public List<Message> getMessageList() {
		return messageList;
	}
	public void setMessageList(List<Message> messageList) {
		this.messageList = messageList;
	}
	public List<Issues> getIssuesList() {
		return issuesList;
	}
	public void setIssuesList(List<Issues> issuesList) {
		this.issuesList = issuesList;
	}
	
}
